# 1.导包
import time
from selenium import webdriver
from selenium.webdriver.chrome.service import Service
from selenium.webdriver.common.by import By

# 2.打开浏览器（创建浏览器驱动对象）
path = r"C:\Program Files\Python311\chromedriver.exe"
ser = Service(executable_path=path)  # Chrome浏览器驱动服务对象
driver = webdriver.Chrome(service=ser)  # 打开Chrome浏览器
# 3.输入网址
driver.get("http://121.43.169.97:8082/")
# 4.页面操作
driver.find_element(By.ID, 'username').send_keys('admin')
driver.find_element(By.ID, 'password').send_keys('HM_2025_test')
driver.find_element(By.ID, 'valicode').send_keys('8888')
driver.find_element(By.CLASS_NAME, 'login-button').click()
time.sleep(2)
driver.find_element(By.LINK_TEXT,'借款管理').click()
driver.find_element(By.XPATH,'//*[text()="额度管理"]').click()
time.sleep(1)
driver.find_element(By.XPATH,'//*[@id="sidebar"]/ul/li[5]/ul/li[2]/a').click()
time.sleep(1)
fr_ele=driver.find_element(By.ID,'iframe_box')
driver.switch_to.frame(fr_ele)
driver.find_element(By.CLASS_NAME,'id').click()
time.sleep(2)
driver.find_element(By.XPATH,'/html/body/div[2]/div[2]/ul/li[1]/a/span').click()
time.sleep(2)
fff= driver.find_element(By.XPATH,'//*[@id="xubox_iframe1"]')
driver.switch_to.frame(fff)
# /html/body/div[2]/div[1]/div/ul/li[1]/div/input
driver.find_element(By.XPATH,'/html/body/div[2]/form/table/tbody/tr[5]/td[2]/div/label[1]').click()
driver.find_element(By.XPATH,'/html/body/div[2]/form/table/tbody/tr[6]/td[2]/div/textarea').send_keys('111')
driver.find_element(By.NAME,'valicode').send_keys('8888')
driver.find_element(By.XPATH,'/html/body/div[2]/form/table/tbody/tr[8]/td[2]/input[1]').click()
# 5.等待2秒
time.sleep(2)
# 6.退出浏览器
driver.quit()

#大王i回答
print('大魔王洛克菲勒')